using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;

using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
using System.Linq;

namespace ILRuntime.Runtime.Generated
{
    unsafe class huqiang_UIComposite_BindingData_Binding
    {
        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
        {
            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
            MethodBase method;
            FieldInfo field;
            Type[] args;
            Type type = typeof(huqiang.UIComposite.BindingData);
            args = new Type[]{typeof(huqiang.Core.HGUI.UIElement)};
            method = type.GetMethod("LoadLayout", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, LoadLayout_0);
            args = new Type[]{typeof(huqiang.Core.HGUI.UIElement)};
            method = type.GetMethod("SaveLayout", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, SaveLayout_1);

            field = type.GetField("offset", flag);
            app.RegisterCLRFieldGetter(field, get_offset_0);
            app.RegisterCLRFieldSetter(field, set_offset_0);
            app.RegisterCLRFieldBinding(field, CopyToStack_offset_0, AssignFromStack_offset_0);
            field = type.GetField("width", flag);
            app.RegisterCLRFieldGetter(field, get_width_1);
            app.RegisterCLRFieldSetter(field, set_width_1);
            app.RegisterCLRFieldBinding(field, CopyToStack_width_1, AssignFromStack_width_1);
            field = type.GetField("high", flag);
            app.RegisterCLRFieldGetter(field, get_high_2);
            app.RegisterCLRFieldSetter(field, set_high_2);
            app.RegisterCLRFieldBinding(field, CopyToStack_high_2, AssignFromStack_high_2);
            field = type.GetField("Data", flag);
            app.RegisterCLRFieldGetter(field, get_Data_3);
            app.RegisterCLRFieldSetter(field, set_Data_3);
            app.RegisterCLRFieldBinding(field, CopyToStack_Data_3, AssignFromStack_Data_3);
            field = type.GetField("linker", flag);
            app.RegisterCLRFieldGetter(field, get_linker_4);
            app.RegisterCLRFieldSetter(field, set_linker_4);
            app.RegisterCLRFieldBinding(field, CopyToStack_linker_4, AssignFromStack_linker_4);
            field = type.GetField("layouts", flag);
            app.RegisterCLRFieldGetter(field, get_layouts_5);
            app.RegisterCLRFieldSetter(field, set_layouts_5);
            app.RegisterCLRFieldBinding(field, CopyToStack_layouts_5, AssignFromStack_layouts_5);


            app.RegisterCLRCreateDefaultInstance(type, () => new huqiang.UIComposite.BindingData());
            app.RegisterCLRCreateArrayInstance(type, s => new huqiang.UIComposite.BindingData[s]);

            args = new Type[]{};
            method = type.GetConstructor(flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Ctor_0);

        }


        static StackObject* LoadLayout_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.Core.HGUI.UIElement @trans = (huqiang.Core.HGUI.UIElement)typeof(huqiang.Core.HGUI.UIElement).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.UIComposite.BindingData instance_of_this_method = (huqiang.UIComposite.BindingData)typeof(huqiang.UIComposite.BindingData).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.LoadLayout(@trans);

            return __ret;
        }

        static StackObject* SaveLayout_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.Core.HGUI.UIElement @trans = (huqiang.Core.HGUI.UIElement)typeof(huqiang.Core.HGUI.UIElement).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.UIComposite.BindingData instance_of_this_method = (huqiang.UIComposite.BindingData)typeof(huqiang.UIComposite.BindingData).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.SaveLayout(@trans);

            return __ret;
        }


        static object get_offset_0(ref object o)
        {
            return ((huqiang.UIComposite.BindingData)o).offset;
        }

        static StackObject* CopyToStack_offset_0(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.BindingData)o).offset;
            __ret->ObjectType = ObjectTypes.Float;
            *(float*)&__ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_offset_0(ref object o, object v)
        {
            ((huqiang.UIComposite.BindingData)o).offset = (System.Single)v;
        }

        static StackObject* AssignFromStack_offset_0(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Single @offset = *(float*)&ptr_of_this_method->Value;
            ((huqiang.UIComposite.BindingData)o).offset = @offset;
            return ptr_of_this_method;
        }

        static object get_width_1(ref object o)
        {
            return ((huqiang.UIComposite.BindingData)o).width;
        }

        static StackObject* CopyToStack_width_1(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.BindingData)o).width;
            __ret->ObjectType = ObjectTypes.Float;
            *(float*)&__ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_width_1(ref object o, object v)
        {
            ((huqiang.UIComposite.BindingData)o).width = (System.Single)v;
        }

        static StackObject* AssignFromStack_width_1(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Single @width = *(float*)&ptr_of_this_method->Value;
            ((huqiang.UIComposite.BindingData)o).width = @width;
            return ptr_of_this_method;
        }

        static object get_high_2(ref object o)
        {
            return ((huqiang.UIComposite.BindingData)o).high;
        }

        static StackObject* CopyToStack_high_2(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.BindingData)o).high;
            __ret->ObjectType = ObjectTypes.Float;
            *(float*)&__ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_high_2(ref object o, object v)
        {
            ((huqiang.UIComposite.BindingData)o).high = (System.Single)v;
        }

        static StackObject* AssignFromStack_high_2(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Single @high = *(float*)&ptr_of_this_method->Value;
            ((huqiang.UIComposite.BindingData)o).high = @high;
            return ptr_of_this_method;
        }

        static object get_Data_3(ref object o)
        {
            return ((huqiang.UIComposite.BindingData)o).Data;
        }

        static StackObject* CopyToStack_Data_3(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.BindingData)o).Data;
            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance, true);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method, true);
        }

        static void set_Data_3(ref object o, object v)
        {
            ((huqiang.UIComposite.BindingData)o).Data = (System.Object)v;
        }

        static StackObject* AssignFromStack_Data_3(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Object @Data = (System.Object)typeof(System.Object).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.UIComposite.BindingData)o).Data = @Data;
            return ptr_of_this_method;
        }

        static object get_linker_4(ref object o)
        {
            return ((huqiang.UIComposite.BindingData)o).linker;
        }

        static StackObject* CopyToStack_linker_4(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.BindingData)o).linker;
            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_linker_4(ref object o, object v)
        {
            ((huqiang.UIComposite.BindingData)o).linker = (huqiang.UIComposite.Linker)v;
        }

        static StackObject* AssignFromStack_linker_4(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            huqiang.UIComposite.Linker @linker = (huqiang.UIComposite.Linker)typeof(huqiang.UIComposite.Linker).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.UIComposite.BindingData)o).linker = @linker;
            return ptr_of_this_method;
        }

        static object get_layouts_5(ref object o)
        {
            return ((huqiang.UIComposite.BindingData)o).layouts;
        }

        static StackObject* CopyToStack_layouts_5(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.BindingData)o).layouts;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_layouts_5(ref object o, object v)
        {
            ((huqiang.UIComposite.BindingData)o).layouts = (huqiang.UIComposite.BaseLayout[])v;
        }

        static StackObject* AssignFromStack_layouts_5(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            huqiang.UIComposite.BaseLayout[] @layouts = (huqiang.UIComposite.BaseLayout[])typeof(huqiang.UIComposite.BaseLayout[]).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.UIComposite.BindingData)o).layouts = @layouts;
            return ptr_of_this_method;
        }



        static StackObject* Ctor_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* __ret = ILIntepreter.Minus(__esp, 0);

            var result_of_this_method = new huqiang.UIComposite.BindingData();

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }


    }
}
